package com.vise.facedemo.alioss.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.ListView;

import com.vise.facedemo.R;
import com.vise.facedemo.alioss.adapter.BanSui_Adapter;
import com.vise.facedemo.alioss.http.API;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;


/**
 * 分类
 */
public class Three_Fragment extends Fragment {
    View view;

    Unbinder unbinder;
    @BindView(R.id.activity_main)
    LinearLayout activityMain;
    @BindView(R.id.lv)
    ListView lv;

    BanSui_Adapter banSui_adapter;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        if (view == null) {
            view = View.inflate(getActivity(), R.layout.fragment_f3, null);
            ButterKnife.bind(this, view);
           init();
        }
        ViewGroup parent = (ViewGroup) view.getParent();
        if (parent != null) {
            parent.removeView(view);
        }

        unbinder = ButterKnife.bind(this, view);
        return view;
    }

    private void init() {
        banSui_adapter = new BanSui_Adapter();
        lv.setAdapter(banSui_adapter);
        banSui_adapter.addItem( API.zhengxingBeans);



    }


    @Override
    public void onDestroyView() {
        super.onDestroyView();

    }
}
